#!/usr/bin/env python
# -*- coding: utf-8 -*-

from cherrypy import request


def on_start(app):
    """Initialization code goes here, such as importing controllers and
    setting the routes.
    """
    # All templates for this class are in this directory
    app.gensher.add_search_path(app.directory + "/templates")

    print "Starting example_app"
    from controllers import RootController
    c = RootController() # instantiate the controller
    connect = app.dispatch.connect
    # Set up the routes for RootController
    connect(name="Root", route="/:action", controller=c, action="index",
            requirements=dict(
                action="index|err",
            )
    )
    
